<template>
	<view>
		<baseForm :column.sync="column" @submitFun="submitFun" :submitStatus="submitDisable" :button="button">
			<view class="normalInput">
				<text v-text="telObj.label" ></text>
				<input
					class="uni-input"
					placeholder-class="input-placeholder"
					:value="telObj.value"
					:placeholder="`请填写${telObj.label}`"
					:disabled="telObj.disabled"
					:name="telObj.name"
					@input="change"
				/>
				<view class="copyBtn" @click="copyTel" v-show="telObj.value">点击复制</view>
			</view>
		</baseForm>
	</view>
</template>

<script>
import baseForm from '@/wxcomponents/form/form.vue';
import formMixins from '@/libs/formMixins.js'
export default {
	mixins: [formMixins],
	data() {
		return {
			itemData: '',
			button: {
				hide: true
			},
			telObj:{
				label: '手机号',
				name: 'mobilePhone',
				type: 'normalInput',
				disabled: true,
				required: false,
				value: null
				},
			column: [
				{
					label: '姓名',
					name: 'teacherName',
					type: 'normalInput',
					disabled: true,
					required: false,
					value: '姓名'
				},
				{
					label: '所属部门',
					name: 'deptName',
					type: 'normalInput',
					disabled: true,
					required: false,
					value: '所属部门',
					text: '',
				},
				{
					label: '工号',
					name: 'jobNumber',
					type: 'normalInput',
					disabled: true,
					required: false,
					value: '工号'
				},
				// {
				// 	label: '手机号',
				// 	name: 'mobilePhone',
				// 	type: 'normalInput',
				// 	disabled: true,
				// 	required: false,
				// 	value: '手机号'
				// }
			],
		};
	},
	async onLoad(option) {
		// this.itemData = JSON.parse(option.data);
		this.assignFormDataToViewModel(JSON.parse(option.data), this.column);
		this.telObj.value = JSON.parse(option.data).mobilePhone
	},
	methods: {
		copyTel(){
			uni.setClipboardData({
			  data: this.telObj.value,
			  success (res) {
				  // uni.hideToast();
			  },
			  fail(e) { }
			})

		},
		async getDetail() {
			let resp = await this.$http.get({
				url: `/oa/sealApply/detail/${this.itemData.id}`
			});
			this.assignFormDataToViewModel(resp.result, this.column);
		}
	},
	components: {
		baseForm
	},
	watch: {}
};
</script>

<style  lang="scss" scoped>
	.normalInput {
		border-bottom: 1upx solid #eee;
		margin: 0 50upx;
		// height: 100upx;
		position:relative;
		text {
			display: block;
			text-align: left;
			font-size: 28upx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			margin-top: 20upx;
			// padding: 0 10upx;
		}
		input {
			line-height: 80upx;
			height: 80upx;
			padding: 0 10upx;
			font-size: 32upx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: rgba(51, 51, 51, 1);
		}
	}
	.copyBtn{
		position: absolute;
		right: 20upx;
		padding: 10upx;
		border: 1upx solid #007AFF;
		border-radius: 10upx;
		font-size: 24upx;
		color: #999;
		bottom: 20upx;
		z-index: 5;
		}
</style>
